netfilter: nf_tables: hold mutex on netns pre_exit path
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 May 2022 16:24:05 +0000 (18:24 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 27 Jul 2023 22:17:15 +0000 (23:17 +0100)
commite71ecdd547f6211dca4a7b251e68bb34ab24a136
treeca47db8053d4283258a1f42191eed8f0c0309bfd
parent270ae3d192cf1b13371175998c413ebf1c3deafb
netfilter: nf_tables: hold mutex on netns pre_exit path

Origin: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit?id=8b7454dd984a75d0eaa6a02940c65cd3671fcddc

commit 3923b1e4406680d57da7e873da77b1683035d83f upstream.

clean_net() runs in workqueue while walking over the lists, grab mutex.

Fixes: 767d1216bff8 ("netfilter: nftables: fix possible UAF over chains from packet path in netns")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name netfilter-nf_tables-hold-mutex-on-netns-pre_exit-pat.patch
net/netfilter/nf_tables_api.c